<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
    <div class="container">
      <div class="jeecg-login">
        <a-col :xl="12" :lg="0" :md="0" :sm="0" >
          <div style="margin-left: 5%;text-align: center">
          <a-col :xl="24" :lg="0" :md="0" :sm="0" >
            <img :src="logo" class="logo">
            <span class="login-title" >欢迎进入管理端登录页</span>
          </a-col>
          <div  class="div-h" style=""></div>
          <a-col :xl="24" :lg="0" :md="0" :sm="0" >
            <img src="~@/assets/user/login-worker.svg" style="width: 300px; ">
          </a-col>
          <a-col :xl="24" :lg="0" :md="0" :sm="0" >
            <div class="mt-10 font-medium text-white -enter-x">
              <span class="inline-block mt-4 text-3xl">{{english}}</span>
            </div>
            <div class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x">
              {{name}}
            </div>
          </a-col>
        </div>
        </a-col>
        <a-col :xl="12" :lg="16" :md="20" :sm="24" >
          <route-view></route-view>
        </a-col>
      </div>
    </div>
  </div>
</template>

<script>
  import RouteView from "@/components/layouts/RouteView"
  import { mixinDevice } from '@/utils/mixin.js'
  import { httpAction, getAction } from '@/api/manage'
  export default {
    name: "UserLayout",
    components: { RouteView },
    mixins: [mixinDevice],

    data () {
      return {
        url :'/yw/api/common/config',
        logo:'',
        name:'',
        english:'',
      }
    },
    created() {
      this.getLogo();
    },
    methods: {
      getLogo() {
        let that = this;
        httpAction(this.url + "?codes=name,english,logo", null, 'post').then((res) => {
          if (res.success) {
            that.logo = res.result.logo.value;
            that.name = res.result.name.value;
            that.english = res.result.english.value;
          } else {
            that.$message.warning(res.message);
          }
        })
      },
    },
    /*data () {
      return {}
    },*/
    mounted () {
      document.body.classList.add('userLayout')
    },
    beforeDestroy () {
      document.body.classList.remove('userLayout')
    },
  }
</script>

<style lang="less" scoped>
  #userLayout.user-layout-wrapper {
    height: 100%;
    .logo{
      height: 40px;
      margin-top: -5px;
    }
    .mt-4 {
      font-weight: bold;
      margin-top: 3rem;
    }
    .text-3xl {
      font-size: 1.175rem;
      line-height: 2.25rem;
    }
    .inline-block {
      display: inline-block;
    }

    .text-white {
      font-size: 1.875rem;
      --tw-text-opacity: 1;
      color: rgba(255,255,255,var(--tw-text-opacity));
    }


    .mt-5 {
      margin-top: 1.25rem;
    }

    .div-h{
      height:260px;
      content: "";
    }
    .jeecg-login:before{
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      margin-left: -48%;
      background-image: url(~@/assets/user/login-back.svg);
      background-position: 100%;
      background-repeat: no-repeat;
      background-size: auto 100%;
      content: "";
    }
    .login-title{
      color: #FFFFFF;
      font-size: 24px;
      font-weight: 700;
      transition: all .5s;
      line-height: normal;
      margin-left: 12px;
      margin-bottom: 50px;
    }
    &.mobile {
      .container {
        .main {
          max-width: 368px;
          width: 98%;
        }
      }
    }


    .container {
      width: 100%;
      min-height: 100%;
      background-size: cover;
      padding: 90px 0 144px;
      position: relative;
      a {
        text-decoration: none;
      }
      .main {
        min-width: 360px;
        width: 100%;
        margin: 0 auto;
      }

      .footer {
        position: absolute;
        width: 100%;
        bottom: 0;
        padding: 0 16px;
        margin: 48px 0 24px;
        text-align: center;

        .links {
          margin-bottom: 8px;
          font-size: 14px;
          a {
            color: rgba(0, 0, 0, 0.45);
            transition: all 0.3s;
            &:not(:last-child) {
              margin-right: 40px;
            }
          }
        }
        .copyright {
          color: rgba(0, 0, 0, 0.45);
          font-size: 14px;
          a{
            color: #fff;
          }
        }
      }
    }
  }
</style>